package com.softeem.blog.service;

import org.eclipse.jdt.core.compiler.CategorizedProblem;

import com.softeem.blog.dao.AdDAO;
import com.softeem.blog.dao.ArticleDAO;
import com.softeem.blog.dao.CategoryDAO;
import com.softeem.blog.dao.CommentDAO;
import com.softeem.blog.dao.LinkDAO;
import com.softeem.blog.dao.MessageDAO;
import com.softeem.blog.dao.UserDAO;
import com.softeem.blog.dto.Dashboard;

public class DashboardService {

	private UserDAO userDAO = new UserDAO();
	private ArticleDAO aritcleDAO = new ArticleDAO();
	private MessageDAO messageDAO = new MessageDAO();
	private CategoryDAO categoryDAO = new CategoryDAO();
	private CommentDAO commentDAO = new CommentDAO();
	private LinkDAO linkDAO = new LinkDAO();
	private AdDAO adDAO = new AdDAO();
	
	public Dashboard loadPreviewData(){
		Dashboard d = new Dashboard();
		d.setUserCount(userDAO.getCount());
		d.setArticleCount(aritcleDAO.getCount());
		d.setMessageCount(messageDAO.getCount());
		d.setCategoryCount(categoryDAO.getCount());
		d.setCommentCount(commentDAO.getCount());
		d.setLinkCount(linkDAO.getCount());
		d.setAdCount(adDAO.getCount());
		return d;
	}
	
}
